package cn.com.swu.mianyangapp.ui.notifications;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.TextView;

import cn.com.swu.mianyangapp.R;
import cn.com.swu.mianyangapp.bean.Notice;

public class ViewNoticeActivity extends AppCompatActivity {

    Notice notice=new Notice();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_view_notice);

        TextView noticeTitle=findViewById(R.id.Ntitle);
        TextView noticeContnt=findViewById(R.id.notice_contnt);
        TextView publisher=findViewById(R.id.publisher);
        TextView startTime=findViewById(R.id.start_time);
        TextView clicks=findViewById(R.id.clicks);

        Bundle bundle = this.getIntent().getExtras();

        if(bundle!=null)
        {
            notice.setNoticeContent(bundle.get("mnoticeContent").toString());
            notice.setNoticeTitle(bundle.get("mnoticeTitle").toString());
            notice.setClicks(Integer.parseInt(bundle.get("mClicks").toString()));
            notice.setStartTime(bundle.get("mStartTime").toString());
            notice.setPublisherID(Integer.parseInt(bundle.get("mpublisherID").toString()));

            noticeTitle.setText(notice.getNoticeTitle());
            noticeContnt.setText(notice.getNoticeContent());
            publisher.setText("发布人："+notice.getPublisherID()+"");
            startTime.setText("发布时间："+notice.getStartTime());
            clicks.setText("点击量："+notice.getClicks()+"");
        }




    }
}